package entity.sparemanage.dto;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import entity.sparemanage.Outwarehousing;

public class OutWareHouseWrapper {
    public QueryWrapper<Outwarehousing> OutWareHouseWrapper(warehouseDto warehouseDto){
        QueryWrapper<Outwarehousing> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("delete_flag",0);
        if (warehouseDto.getCodeName()!=null){
            queryWrapper.like("ware_code",warehouseDto.getCodeName()).or().like("ware_theme",warehouseDto.getCodeName());
        }
        if (warehouseDto.getWareCode()!=null){
            queryWrapper.eq("ware_code",warehouseDto.getWareCode());
        }
        if (warehouseDto.getWareName()!=null){
            queryWrapper.eq("ware_name",warehouseDto.getWareName());
        }
        if (warehouseDto.getWareTime()!=null){
            queryWrapper.eq("ware_time",warehouseDto.getWareTime());
        }
        if (warehouseDto.getWareType()!=null){
            queryWrapper.eq("ware_type",warehouseDto.getWareType());
        }
        if (warehouseDto.getUpdateTime()!=null){
            queryWrapper.eq("update_time",warehouseDto.getUpdateTime());
        }
        if (warehouseDto.getWarePersonid()!=null){
            queryWrapper.eq("ware_personid",warehouseDto.getWarePersonid());
        }
        return queryWrapper;
    }
}
